#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'r1.fq r2.fq'
exit 2
}

while getopts  ":p:f:" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
		f) suffix=$OPTARG;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi

. $var

a=a3_10.fa

echo -e ">a3_10\nAGATCGGAAG" > a3_10.fa

a=$tools_path/Trimmomatic-0.36/adapters/TruSeq2-PE.fa

${java_run}/trimmomatic PE -threads $threads -phred33 \
$1 $2 \
$out_prefix.1.trim.fq \
$out_prefix.1.unpair.fq \
$out_prefix.2.trim.fq \
$out_prefix.2.unpair.fq \
ILLUMINACLIP:$a:2:30:10 \
LEADING:20 \
TRAILING:20 \
SLIDINGWINDOW:5:20 \
MINLEN:30

# ${java_run}/trimmomatic SE -threads $threads -phred33 $1 $out_prefix.se.1.trim.fq ILLUMINACLIP:$a:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:30

# ${java_run}/trimmomatic SE -threads $threads -phred33 $2 $out_prefix.se.2.trim.fq ILLUMINACLIP:$a:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:30

. $cmd_done